package 晚间作业0319;

import java.util.*;

/**
 * #### 3.(中等)
 *
 * 有一个list,元素是"hell","world","ok","good"
 * 要求:完成排序,使用Collections的sort方法按照从短到长
 * 使用匿名内部类和lambda表达式实现
 */
public class Doc_Cus3 {

    public static void main(String[] args) {
        List<String> list = Arrays.asList("hell","world","ok","good");
        Collections.sort(list, Comparator.comparingInt(String::length));
        System.out.println(list);
    }
}
